package com.woniuxy.hrp.provider;

import com.woniuxy.hrp.entity.AdminDoctorAndTime;
import com.woniuxy.hrp.entity.Department;
import org.apache.ibatis.jdbc.SQL;

public class DoctorAndTimeSqlProvider {
    //修改排班信息动态SQL
    public static String updateDTByCondition(AdminDoctorAndTime adminDoctorAndTime){
        String sql = new SQL(){
            {
                UPDATE("hrp_doctor_time");
                if (adminDoctorAndTime.getArrangeTimeId() != 0){
                    SET("arrangetime_id=#{arrangeTimeId}");
                }
                if (adminDoctorAndTime.getNum()!= 0){
                    SET("num=#{num}");
                }
                if (adminDoctorAndTime.getStatus() != null){
                    SET("status=#{status}");
                }
                WHERE("id=#{id}");
            }
        }.toString();
        return sql;
    }
}
